<!DOCTYPE html>
<html>
<head>
    <title>平台进货记录</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.goodName" @on-enter="query" placeholder="输入商品名称查询"/>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.orderNo" @on-enter="query" placeholder="输入订单号查询"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("invoicing:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("invoicing:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("invoicing:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="invoicing" :rules="ruleValidate" :label-width="80">
            <Form-item  label="产品类型">
                <i-select v-model="invoicing.productTypeId" @on-change="getGoods" filterable>
                    <i-option v-for="productType in productTypes" :value="productType.id" :key="productType.id">{{productType.name}}</i-option>
                </i-select>
            </Form-item>
            <Form-item  label="商品名称">
                <i-select id= "goodName" v-model="invoicing.goodId" @on-change="queryProduct" filterable>
                    <i-option v-for="good in goods" :value="good.id" :key="good.id" >{{good.name}}</i-option>
                </i-select>
            </Form-item>
            <Form-item  label="产品规格">
                <i-select v-model="invoicing.productId" @on-change="setProductInfo" filterable>
                    <i-option v-for="product in products" :value="product.id" :key="product.id">{{product.specificationValue}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="商铺名称">
                <i-input v-model="invoicing.shopId" placeholder="平台" value = "1" disabled = true  />
            </Form-item>
            <Form-item label="进货单价">
                <i-input v-model="invoicing.goodPrice" number=true placeholder="进货单价 "/>
            </Form-item>
            <Form-item label="进货数量">
                <i-input v-model="invoicing.invoicingNum" number=true placeholder="进销数量 "/>
            </Form-item>

            <Form-item label="实付总价">
                <i-input v-model="invoicing.totalPrice" placeholder="实付总价 "/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script src="${rc.contextPath}/js/shop/platformPurchase.js?_${date.systemTime}"></script>
</body>
</html>